package com.topisv.tms.service.shipped;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.topisv.tms.entity.ShippedBoxOrdeno;
import com.topisv.tms.repository.ShippedBoxOrdenoDao;

@Component
@Transactional(readOnly = true)
public class ShippedBoxOrdenoService {

	@Autowired
	private ShippedBoxOrdenoDao shippedBoxOrdenoDao;
	
	public List<ShippedBoxOrdeno> findByBatchCodeAndStatus(String batchCode,String status){
		return shippedBoxOrdenoDao.findByBatchCodeAndStatus(batchCode, status);
	}
	@Transactional(readOnly = false)
	public ShippedBoxOrdeno save(ShippedBoxOrdeno arg0) throws Exception {
		try {
			return shippedBoxOrdenoDao.save(arg0);
		} catch (Exception e) {
			throw e;
		}
	}

	public List<ShippedBoxOrdeno> findByBoxCode(String boxCode)
			throws Exception {
		try {
			return shippedBoxOrdenoDao.findByBoxCode(boxCode);
		} catch (Exception e) {
			throw e;
		}
	}

	public List<ShippedBoxOrdeno> findByStatus(String status) throws Exception {
		try {
			return shippedBoxOrdenoDao.findByStatus(status);
		} catch (Exception e) {
			throw e;
		}
	}

	public ShippedBoxOrdeno findByBoxCodeAndOrdeno(String boxCode, String ordeno)
			throws Exception {
		try {
			return shippedBoxOrdenoDao.findByBoxCodeAndOrdeno(boxCode, ordeno);
		} catch (Exception e) {
			throw e;
		}
	}

	public ShippedBoxOrdeno findByOrdeno(String ordeno) throws Exception {
		try {
			return shippedBoxOrdenoDao.findByOrdeno(ordeno);
		} catch (Exception e) {
			throw e;
		}
	}

	public List<ShippedBoxOrdeno> findByBatchCode(String batchCode)
			throws Exception {
		try {
			return shippedBoxOrdenoDao.findByBatchCode(batchCode);
		} catch (Exception e) {
			throw e;
		}
	}

	public List<ShippedBoxOrdeno> findByBatchCodeAndBoxCode(String batchCode,
			String boxCode) throws Exception {
		try {
			return shippedBoxOrdenoDao.findByBatchCodeAndBoxCode(batchCode,
					boxCode);
		} catch (Exception e) {
			throw e;
		}

	}
}
